home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1999 Spring / macformat-077.iso / Shareware Plus / Development / Akua Sweets 131 / Akua Sweets Examples / Imaging / Spirals < prev    next >
Encoding:
Text File  |  1999-03-04  |  1.2 KB  |  57 lines  |  [TEXT/ToyS]

  1. on idle
  2.     set dims to random number from 200 to 500
  3.     set midP to round (dims / 2)
  4.     set incr to random number from 2 to 11
  5.     
  6.     set drawWin to ¬
  7.         display drawing titled ¬
  8.             "Spiral 1.0" with dimensions {dims, dims}
  9.     
  10.     -- Set color
  11.     draw into drawWin ¬
  12.         using state {fg col64:{random number from 1 to 33333, random number from 1 to 33333, random number from 1 to 33333}}
  13.     
  14.     set box to {0, 0, dims, dims}
  15.     
  16.     -- Across the top
  17.     repeat with x from 0 to midP by incr
  18.         draw an arc into drawWin ¬
  19.             inside of box ¬
  20.             with scale {0, 90} -- TC to CR
  21.         
  22.         -- Pull up bottom
  23.         set item 4 of box to (item 4 of box) - incr
  24.         
  25.         draw an arc into drawWin ¬
  26.             inside of box ¬
  27.             with scale {90, 90} -- CR to BC
  28.         
  29.         -- Pull in left
  30.         set item 1 of box to (item 1 of box) + incr
  31.         
  32.         draw an arc into drawWin ¬
  33.             inside of box ¬
  34.             with scale {180, 90} -- BC to CL
  35.         
  36.         -- Pull down top
  37.         set item 2 of box to (item 2 of box) + incr
  38.         
  39.         draw an arc into drawWin ¬
  40.             inside of box ¬
  41.             with scale {270, 90} -- CL to TC
  42.         
  43.         -- Pull in right
  44.         set item 3 of box to (item 3 of box) - incr
  45.     end repeat
  46.     
  47.     -- Refresh
  48.     draw into drawWin ¬
  49.         with refresh
  50.     
  51.     pause for 5 with seconds timing
  52.     
  53.     display drawing drawWin with disposal
  54.     
  55.     return 5
  56. end idle
  57.